﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for News
/// </summary>
public class News
{
    public int News_id { get; set; }
    public string Title { get; set; }
    public int CategoryNews_id { get; set; }
    public string Image { get; set; }
    public string Description { get; set; }
    public string Content { get; set; }
    public string Url { get; set; }
    public bool Status { get; set; }
    public DateTime DateStart { get; set; }
    public DateTime DateUpdate { get; set; }
	public News()
	{
	    this.News_id = 0;
	    this.Title = "";
	    this.CategoryNews_id = 0;
	    this.Image = "";
	    this.Description = "";
	    this.Content = "";
	    this.Url = "";
	    this.Status = true;
	    this.DateStart = DateTime.Now;
	    this.DateUpdate = DateTime.Now;
	}
    public News(DataRow dr)
    {
        this.News_id = Convert.ToInt32(dr[0].ToString());
        this.Title = dr[1].ToString();
        this.CategoryNews_id = Convert.ToInt32(dr[2].ToString());
        this.Image = dr[3].ToString();
        this.Description = dr[4].ToString();
        this.Content = dr[5].ToString();
        this.Url = dr[6].ToString();
        this.Status = Boolean.Parse(dr[7].ToString());
        this.DateStart = DateTime.Parse(dr[8].ToString());
        if (dr[9].ToString() != "" && dr[9].ToString()!=null)
            this.DateUpdate = DateTime.Parse(dr[9].ToString());
    }
}